package com.fingard.dsp.bank.reqrespobj.balance;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.balance.detail.RetAtsBalDetail;
import com.fingard.xml.XmlTextWriter;

public class RetAts7506BalQry extends RetAtsBase {
	
	public RetAts7506BalQry(ReqRespHeader p_header){
		retHeader = p_header;
		retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
	}
	
	
	public void writeRetDetail(RetAtsBalDetail p_retDetail, boolean p_isBatch) throws Exception{
		if(p_isBatch){
			if(!hasWrittenRespCode){
				writeRespCode("0");
			}
			if(!hasWrittenRespInfo){
				writeRespInfo("");
			}
			retXmlWriter.writeStartElement("DetailRecord");
		}
		retXmlWriter.writeElementString("RespCode", p_retDetail.respCode);
		retXmlWriter.writeElementString("RespInfo", p_retDetail.respInfo);
		retXmlWriter.writeElementString("ActArea", p_retDetail.actArea);
		retXmlWriter.writeElementString("ActCur", p_retDetail.actCur);
		retXmlWriter.writeElementString("ActNum", p_retDetail.actNum);
		
		retXmlWriter.writeElementString("CurrBal", p_retDetail.currBal);
		retXmlWriter.writeElementString("AvailBal", p_retDetail.availBal);
		retXmlWriter.writeElementString("FrozenBal", p_retDetail.frozenBal);
		retXmlWriter.writeElementString("LastTranDate", p_retDetail.lastTranDate);
		retXmlWriter.writeElementString("YesterdayBal", p_retDetail.yesterdayBal);
		retXmlWriter.writeElementString("CashPoolBal", p_retDetail.cashPoolBal);
		retXmlWriter.writeElementString("CashPoolAvailBal", p_retDetail.cashPoolAvailBal);

        retXmlWriter.writeElementString("CustName", p_retDetail.custName);
        retXmlWriter.writeElementString("ActCurName", p_retDetail.actCurName);
        retXmlWriter.writeElementString("AcState", p_retDetail.acState);
        retXmlWriter.writeElementString("BankName", p_retDetail.bankName);
        retXmlWriter.writeElementString("CountryName", p_retDetail.countryName);

		if(p_isBatch){
			retXmlWriter.writeEndElement();
		}
	}
}
